package com.tuniu.agents.impl.evaluator;

import org.springframework.ai.chat.prompt.ChatOptions;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.tuniu.agents.agent.AgentManagerGroup;
import com.tuniu.agents.impl.evaluator.impl.CartEvaluatorAgent;
import com.tuniu.agents.impl.evaluator.impl.FavoritesEvaluatorAgent;

import lombok.SneakyThrows;

/**
 * Evaluator Agent Bean Configuration
 */
//@Configuration
public class EvaluatorAgentConfig {

    // Shopping Cart Evaluator Configuration
    public static final String CART_EVALUATOR_AGENT_ID = "CART_EVALUATOR";
    public static final String CART_EVALUATOR_PROMPT_TEMPLATE_ID = "cart-evaluator";

    // Favorites Evaluator Configuration
    public static final String FAVORITES_EVALUATOR_AGENT_ID = "FAVORITES_EVALUATOR";
    public static final String FAVORITES_EVALUATOR_PROMPT_TEMPLATE_ID = "favorites-evaluator";


    // You can add configurations for other evaluators
    // public static final String OTHER_EVALUATOR_AGENT_ID = "OTHER_EVALUATOR";
    // public static final String OTHER_EVALUATOR_PROMPT_TEMPLATE_ID = "other-evaluator";

    @Bean(CART_EVALUATOR_AGENT_ID)
    @SneakyThrows
    public CartEvaluatorAgent cartEvaluatorAgent(AgentManagerGroup agentManagerGroup) {
        return new CartEvaluatorAgent(agentManagerGroup, CART_EVALUATOR_AGENT_ID, CART_EVALUATOR_PROMPT_TEMPLATE_ID);
    }

    @Bean(FAVORITES_EVALUATOR_AGENT_ID)
    @SneakyThrows
    public FavoritesEvaluatorAgent favoritesEvaluatorAgent(AgentManagerGroup agentManagerGroup, @Qualifier("DEEPSEEK_R1") ChatOptions chatOptions) {
        return new FavoritesEvaluatorAgent(agentManagerGroup, FAVORITES_EVALUATOR_AGENT_ID, FAVORITES_EVALUATOR_PROMPT_TEMPLATE_ID, chatOptions);
    }

    // You can add Bean configurations for other evaluator Agents
    // @Bean(OTHER_EVALUATOR_AGENT_ID)
    // @SneakyThrows
    // public OtherEvaluatorAgent otherEvaluatorAgent(AgentManagerGroup agentManagerGroup) {
    //     return new OtherEvaluatorAgent(agentManagerGroup, OTHER_EVALUATOR_AGENT_ID, OTHER_EVALUATOR_PROMPT_TEMPLATE_ID);
    // }
}